-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ILM to DSL migration test for BA. #106054
Conversation
Pinging @elastic/ent-search-eng (Team:Enterprise Search) |
Tested using:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments and questions
...-restart/src/javaRestTest/java/org/elasticsearch/xpack/application/FullClusterRestartIT.java
Outdated
Show resolved
Hide resolved
...-restart/src/javaRestTest/java/org/elasticsearch/xpack/application/FullClusterRestartIT.java
Outdated
Show resolved
Hide resolved
...-restart/src/javaRestTest/java/org/elasticsearch/xpack/application/FullClusterRestartIT.java
Outdated
Show resolved
Hide resolved
assertEquals(true, dataStream.evaluate("lifecycle.enabled")); | ||
assertEquals("180d", dataStream.evaluate("lifecycle.data_retention")); | ||
assertEquals("Data stream lifecycle", dataStream.evaluate("next_generation_managed_by")); | ||
assertEquals(false, dataStream.evaluate("prefer_ilm")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these checks are better indicators than ilm_policy
being null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was not correct and in fact ilm_policy
is not null but the policy is not used since prefer_ilm
is false
.
We was not able to see it before since the test were not executed.
My plan is to open a tech debt issue to check is we can completely remove the ILM policy since it is not used anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the time I believe we had to keep it for BWC reasons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have never been fully convince that we have to keep it.
I mean
- Clusters created before 8.12 will have the ILM policy created before they update and data streams created before the update will use it.
- The registry update does not cleanup useless policies
I created atech debt issue to evaluate if we can remove it.
if (minVersion != null) { | ||
String pathToVersion = "index_templates.0.index_template.version"; | ||
ObjectPath indexTemplatesResponse = ObjectPath.createFromResponse(response); | ||
assertEquals(minVersion, indexTemplatesResponse.evaluate(pathToVersion)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that in the future the index template gets upgraded to a version number > 3? If so, check a greater-or-equals-than relation instead.
Co-authored-by: Adam Demjen <[email protected]>
💔 Backport failed
You can use sqren/backport to manually backport by running |
This PR is a fix for: #104470
The fix consists of an additional verification on the index template existence (or version) before launching the tests.
This additional verification give enough of time time to cluster to finish initializing (or updating.